home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Aug 90 / MacApp.Tech$ 8⁄24⁄90 / 1784-Re[2]-Two Problems-Aug90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.6 KB  |  66 lines  |  [TEXT/GEOL]

  1. Item    1103170                         19-Aug-90        05:03PDT
  2.  
  3. From:   A.XSE007                        Austria - Orthosoft,J Mayrbauer,IDV
  4.  
  5. To:     D4453                           Technically Soft, Chris Lang,PRT
  6.         MACAPP.TECH$                    MacApp Technical
  7.  
  8. Sub:    Re[2]-Two Problems
  9.  
  10. Dear Chris
  11.  
  12.  
  13. Problem One:
  14. You should write your own FailXXXXXX procedure. I've done this for reading in
  15. tiff files:
  16.  
  17. {$S MAFailureRes}
  18. PROCEDURE FailTif(error : Integer);
  19. CONST
  20.    kMsgAlert   = msgAlert DIV $10000;
  21. TYPE
  22.    Converter   = RECORD
  23.    CASE BOOLEAN OF
  24.    TRUE:
  25.    (message:    LongInt);
  26.    FALSE:
  27.    (hiWd, loWd: INTEGER);
  28.    END;
  29. VAR
  30.    c : Converter;
  31. BEGIN
  32.    IF error < noErr THEN
  33.    BEGIN
  34.    c.hiWd := kMsgAlert;
  35.    CASE error OF
  36.    TIFERR_PREEOS:  c.loWd := kTifErrorAlertBase + 1;
  37.    TIFERR_NOTTIFF: c.loWd := kTifErrorAlertBase + 2;
  38.    TIFERR_CANTFINDIFD: c.loWd := kTifErrorAlertBase + 3;
  39.    TIFERR_CANTFINDTAG: c.loWd := kTifErrorAlertBase + 4;
  40.    TIFERR_NOTIMP:  c.loWd := kTifErrorAlertBase + 5;
  41.    TIFERR_SOFTWARE:c.loWd := kTifErrorAlertBase + 6;
  42.    OTHERWISE
  43.    c.loWd := kTifErrorAlertBase + 7;
  44.    END;
  45.    Failure(error, LongInt(c));
  46.    END;
  47. END;
  48.  
  49. You have to build your own message for the failure procedure. The high word
  50. must contain 'kMsgAlert' to signal Failure that you want to use your own alert.
  51. The low word contains the actual alert ID for your alert.
  52. Further information is provided by 'Error and Failure Handling' chapter 7 of
  53. the MacApp Cookbook.
  54.  
  55.  
  56. Problem 2:
  57.  
  58. See DemoText sample.
  59.  
  60.  
  61. Kind regards
  62. Juergen Mayrbaeurl
  63. ORTHOsoft Ges.m.b.H.
  64. ALink: A.XSE007
  65.  
  66.